goto
is an unstructured control flow statement. It makes code less readable and maintainable. Structured control flow statements such
as if
, for
, while
, continue
or break
should be used instead.
Noncompliant Code Example
Compliant Solution
Exceptions
foo: proc options(main);
declare i fixed decimal init (0);
loopLabel:
put list (i);
i = i + 1;
if i < 10 then go to loopLabel; /* Noncompliant - usage of the GO TO statement */
end;